import request from '@/utils/request'
import url from './url'

// 企业分页
export function getTenementPage(params) {
  return request({
    url: url.tenementPage,
    method: 'get',
    params
  })
}

// 增加/编辑
export function editTenement(data = {}) {
  const { dmpTenant } = data
  const apiUrl = dmpTenant.id ? url.tenementUpdate : url.tenementAdd
  return request({
    url: apiUrl,
    method: 'post',
    data
  })
}

// status
export function editTenementStatus(data = {}) {
  return request({
    url: url.tenementUpdateStatus,
    method: 'post',
    data
  })
}

// 详情
export function getTenementDatil(params = {}) {
  return request({
    url: url.tenementById,
    method: 'get',
    params
  })
}

// 企业总数
export function getTenementNumber(params = {}) {
  return request({
    url: url.numberStatistics,
    method: 'get',
    params
  })
}

// 删除
export function delData(data = {}) {
  return request({
    url: url.tenementDel,
    method: 'post',
    data
  })
}
